///*
// * Powered By XY
// * Since 2020
// */
//
//package com.xy.biz.uc.manager.impl;
//
//import com.xy.biz.uc.dao.TeamUserRelDao;
//import com.xy.biz.uc.domain.bo.TeamUserRelBO;
//import com.xy.biz.uc.domain.converter.TeamUserRelConverter;
//import com.xy.biz.uc.domain.po.TeamUserRelPO;
//import com.xy.biz.uc.domain.query.TeamUserRelQuery;
//import com.xy.biz.uc.domain.req.DeleteTeamUserRelRequest;
//import com.xy.biz.uc.domain.req.SaveTeamUserRelRequest;
//import com.xy.biz.uc.manager.TeamUserRelManager;
//import com.xy.tool.context.UserContextHolder;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//import org.springframework.util.CollectionUtils;
//
//import java.time.LocalDateTime;
//import java.util.Collection;
//import java.util.List;
//
///**
// *
// *
// * @author yzh
// * @date 2021-4-26
// */
//@Service
//public class TeamUserRelManagerImpl implements TeamUserRelManager {
//
//	@Autowired
//	private TeamUserRelDao teamUserRelDao;
//
//	@Override
//	public int saveTeamUserRel(TeamUserRelBO teamUserRelBO) {
//		return teamUserRelDao.saveTeamUserRel(TeamUserRelConverter.toPO(teamUserRelBO));
//	}
//
//	@Override
//	public int saveAllTeamUserRel(Collection<TeamUserRelBO> collection) {
//		return teamUserRelDao.saveAllTeamUserRel(TeamUserRelConverter.toPO(collection));
//	}
//
//	@Override
//	public int updateTeamUserRel(TeamUserRelBO teamUserRelBO) {
//		return teamUserRelDao.updateTeamUserRel(TeamUserRelConverter.toPO(teamUserRelBO));
//	}
//
//	@Override
//	public int deleteTeamUserRel(DeleteTeamUserRelRequest request) {
//		return teamUserRelDao.deleteTeamUserRel(request);
//	}
//
//	@Override
//	public List<TeamUserRelBO> listTeamUserRel(TeamUserRelQuery query) {
//		return TeamUserRelConverter.fromPO(teamUserRelDao.listTeamUserRel(query));
//	}
//
//	@Override
//	public int countTeamUserRel(TeamUserRelQuery query) {
//		return teamUserRelDao.countTeamUserRel(query);
//	}
//
//	@Override
//	public int inviteJoin(SaveTeamUserRelRequest request) {
//		//查询已存在
//		List<Long> longs = teamUserRelDao.repeatUserId(request);
//		List<Long> userIdList = request.getUserIdList();
//		userIdList.removeAll(longs);
//		if (CollectionUtils.isEmpty(userIdList)) {
//			return 0;
//		}
//		TeamUserRelPO teamUserRelPO = new TeamUserRelPO();
//		teamUserRelPO.setTeamId(request.getTeamId());
//		teamUserRelPO.setUserIdList(request.getUserIdList());
//		teamUserRelPO.setJoinStatus(1);
//		teamUserRelPO.setRole(0);
//		LocalDateTime now = LocalDateTime.now();
//		teamUserRelPO.setCreateTime(now);
//		teamUserRelPO.setJoinTime(now);
//		teamUserRelPO.setCreateUserId(UserContextHolder.getUserId());
//		return teamUserRelDao.inviteJoin(teamUserRelPO);
//	}
//
//}
